<form id="add-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="">
    {:token()}

    <div class="form-group">
        <label for="c-local" class="control-label col-xs-12 col-sm-2">商品分类</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[category_id]', $categoryList, null, ['class'=>'form-control','required'=>''])}
        </div>
    </div>

    <div class="form-group">
        <label for="c-title" class="control-label col-xs-12 col-sm-2">商品标题:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" name="row[title]" id="c-title" class="form-control" data-rule="required;" />
        </div>
    </div>

    <div class="form-group">
        <label for="c-price" class="control-label col-xs-12 col-sm-2">商品价格:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" name="row[price]" id="c-price" class="form-control" data-rule="required;integer" />
        </div>
    </div>

    <div class="form-group">
        <label for="c-weigh" class="control-label col-xs-12 col-sm-2">排序:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" name="row[weigh]" id="c-weigh" class="form-control" value="9999"
                data-rule="required;integer" />
        </div>
    </div>

    <div class="form-group">
        <label for="c-weigh" class="control-label col-xs-12 col-sm-2">推荐:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[is_recommand]', ['1'=>'是', '0'=>'否'],"0")}
        </div>
    </div>


    <div class="form-group">
        <label for="c-cover" class="control-label col-xs-12 col-sm-2">商品封面图:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" name="row[cover]" id="c-cover" class="form-control" data-rule="required;" />
            <ul class="row list-inline faupload-preview" id="p-cover"></ul>
        </div>
    </div>
    <div class="form-group">
        <label for="c-local" class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="button" id="faupload-local" class="btn btn-primary faupload" data-input-id="c-cover"
                data-multiple="false" data-preview-id="p-cover" data-url="{:url('ajax/upload')}"><i
                    class="fa fa-upload"></i>上传到服务器</button>
        </div>
    </div>

    <div class="form-group">
        <label for="c-content" class="control-label col-xs-12 col-sm-2">描述</label>
        <div class="col-xs-12 col-sm-8">
            <textarea rows="23" name="row[description]" class="tinymce"></textarea>
        </div>
    </div>

    <div class="form-group hidden layer-footer">
        <div class="col-xs-2"></div>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>